package main

import "fmt"

type person struct {
	name string
	age  int
}

type point struct {
	x int
	y int
}

type rect struct {
	p1, p2 *point
}

//类型别名
type myInt int

//给int也追加方法
func (i myInt) printMe() {
	fmt.Printf("i is %d", i)
}

func main() {
	var p person
	p.name = "yangjie"
	p.age = 23
	fmt.Println(p)

	var p1 *person = &person{name: "chengfei", age: 12}
	(*p1).name = "hello"
	fmt.Printf("p1指向的对象的地址:%v,p1指针的地址:%v,p1指向的对象%v", p1, &p1, *p1)
}
